﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mBlog.Data.Entities;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;

namespace mBlog.Data
{
    public interface IRepository<T> where T : class
    {
        //void Attach(T t);
        void Delete(T t);

        //void MarkAsModified(T t);
        //IList<object> Read(string storedProcedureName);

        T Add(T t);
        T Find(object key);
        T Single(Func<T, bool> pred);
        IQueryable<T> Where(Func<T, bool> pred);

        IQueryable<T> All();

        void SaveChanges();
    }
}
